package com.cai.oamanager.service.impl;

import com.cai.oamanager.dao.CurricuDao;
import com.cai.oamanager.entity.Course;
import com.cai.oamanager.entity.Curricu;
import com.cai.oamanager.entity.Student;
import com.cai.oamanager.service.CurricuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @version 1.0
 * @author：蔡松坡
 * @date：2021/3/3 10 : 30
 * @package：com.cai.oamanager.service.impl
 */
@Service
public class CurricuServiceImpl implements CurricuService {

    @Autowired
    private CurricuDao curricuDao;
    @Override
    public List<Curricu> getCurricus(String pid, Integer start, Integer size) {

        return curricuDao.getCurricus(pid,start,size);
    }

    @Override
    public void addCurricu(Curricu curricu) {
        curricuDao.addCurricu(curricu);
    }

    @Override
    public void updateCurricu(Curricu curricu) {
        curricuDao.updateCurricu(curricu);
    }

    @Override
    public List<Student> getStudents(String teacherId) {
        return curricuDao.getStudents(teacherId);
    }

    @Override
    public Curricu getOneCurricu(Integer stuId, Integer courseId) {
        return curricuDao.getOneCurricu(stuId,courseId);
    }

    @Override
    public List<Curricu> getAllCurricus(String pid,Integer courseId) {
        System.out.println(pid+"=="+courseId);
        return curricuDao.getAllCurricus(pid,courseId);
    }

    @Override
    public List<Course> getCourse(String semester, String year) {
        return curricuDao.getCourse(semester,year);
    }

    @Override
    public List<Curricu> getCurricuStudent(Integer stuId,String semester,String year) {
        return curricuDao.getCurricuStudent(stuId,semester,year);
    }
}
